package kong

import List.getStudentList1
import java.util.*

fun main(){
test1()
    test2()
}
fun test1(){
    //此时books集合是ArrayList()，只是里面没值
   val stu= getStudentList1().filter { it.name.contains("mm") }
    if(stu[0].books.isEmpty()){
        println("为空")
    }
    //此时books集合是 null
    val stu2 = getStudentList1().filter { it.name.contains("kk") }
    if (stu2[0].books==null){
        println("为空")
    }
    // isNullOrEmpty 字符串，集合都能用，isNullOrBlack,集合不能用
    if(stu[0].books.isNullOrEmpty()){
        println("为空")
    }

    //strings是 ["",""]
    val stu3 = getStudentList1().filter { it.name.contains("ss") }
    if (stu3[0].strings.isNullOrEmpty()){
        println("为空")
    }else{
        println("不为空")
    }

    val st = listOf<String>()
    if (st.isNullOrEmpty()){
        println("为空")
    }else{
        println("No为空")
    }
}


fun test2(){
    val date = Date()
    println(date.time)
}
